package com.example.widgetcase.slice;

import com.example.widget_lib.widget.progress.horbar.LoadingLineView;
import com.example.widgetcase.ResourceTable;
import ohos.aafwk.content.Intent;
import ohos.agp.utils.Color;

import java.text.DecimalFormat;

public class LoadingLineViewAblility extends BaseSlice {
    private DecimalFormat percentFormat =  new DecimalFormat("#.##%");
    public final static int[] COLORS = {
            Color.rgb(88, 181, 250), // 蓝色
            Color.rgb(255, 196, 0), // 黄色
            Color.rgb(101, 226, 175),// 绿色
            Color.rgb(255, 105, 83), //红色
            Color.rgb(202, 129, 222), // 紫色
            Color.rgb(153, 153, 153), // 灰色
            Color.rgb(233, 255, 83) // 浅黄色
    };

    private LoadingLineView bar1;

    @Override
    public int getChildUIContent() {
        return ResourceTable.Layout_loading_line_view;
    }

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        bar1 = (LoadingLineView) findComponentById(ResourceTable.Id_LoadingLine);
        bar1.startLoading();
    }
}
